<style>   
    #testFileInput2{
        height: 30px; width: 102px; margin-left: 128px;
    }
    #preview1, #topPhpto
        {  
            width:150px;  
            padding-left: 65px;padding-top: 15px; border-top-width: 5px;
            //height:150px;  
        }
    #preview2, #topPhpto2{
        width:150px;
        margin-left: 65px;
    }
    .uploadify-button-text{
        width: 100px;
    }
    #testFileInput3-button {
        height: 30px; line-height: 30px; width: 120px; margin-left: 130px;
    }
</style>
<div class="pageContent">	
    <form method="post" action="__MODULE__/User/edit?callbackType=closeCurrent" enctype="multipart/form-data" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> 
        <input type='hidden' name='id' value="<{$userInfo['id']}>"/> 
        <input type="hidden" name='icon' value='<{$userInfo.icon}>' id='icon'/>
        <input type="hidden" name="license" id="license" value="<{$userInfo.license}>"/>
        <div class="pageFormContent" layoutH="58">
            <div class="unit">
                <label>昵　称：</label>
                <input type="text" name="nickName" size="15" minlength="1" maxlength="15"  value="<{$userInfo.nickname}>" class="required"/>
            </div>            
            <div class="unit">
                <label style="width: 107px;">性　别：</label>
                <label style="width: 35px;"><input type="radio" name="sex" value="1" checked />男</label>
                <label><input type="radio" name="sex" value='2'/>女</label> 
            </div>
            <div class="unit">
                <label>用户类型：</label>
                <select class="" name="type" style="width: 101px;">
                    <option value='0' selected="selected" <eq name="sign" value="1">selected</eq>>普通用户</option>
                    <option value="1" <neq name="sign" value="1">selected</neq>>企业用户</option>
                    <option value="2" >管理员</option>
                    <eq name='Think.session.type' value='3'>
                        <option value="3" >开发人员</option>
                    </eq>
                </select>
            </div>
            <eq name="userInfo['id']" value="">
                <div class="unit">
                    <label>密　码：</label>
                    <input type="password" id="cp_newPassword" name="password" size="15" minlength="6" maxlength="20" class="required alphanumeric"/>
                </div>            
                <div class="unit">
                    <label>确认密码：</label>
                    <input type="password" name="rnewPassword" size="15" equalTo="#cp_newPassword" class="required alphanumeric"/>
                </div>
            <else/>
                <div class="unit">
                    <label>密　码：</label>
                    <input type="password" id="cp_newPassword" name="password" size="15" minlength="6" maxlength="20" class="alphanumeric"/>
                </div>            
                <div class="unit">
                    <label>确认密码：</label>
                    <input type="password" name="rnewPassword" size="15" equalTo="#cp_newPassword" class="alphanumeric"/>
                </div>            
            </eq>
            <div class="unit">
                <label>公司名称：</label>
                <input type="text" name="companyName" size="15"  value="<{$userInfo.companyname}>"/>
            </div>
             <div class="unit">
                <label>联系电话：</label>
                <input type="text" name="tel" size="15" class="phone" value="<{$userInfo.tel}>"/>
            </div>
            <div class="unit">
                <label>地区：</label>
                <select class="combox" name="province" ref="w_combox_city" refUrl="__MODULE__/Area/ajaxShowCity/id/{value}">
                    <option value="">所在省</option>
                    <foreach name="provinceData" item="item" >
                        <option <eq name="areaInfo['province']" value="$item['province']">selected</eq> value="<{$item.id}>"><{$item.province}></option>
                    </foreach>
                </select>
                <select class="combox" name="city" id="w_combox_city" ref="w_combox_region" refUrl="__MODULE__/Area/ajaxShowArea/id/{value}">
                    <option value="">所在城市</option>
                    <neq name='cityData' value=''>
                        <foreach name="cityData" item="item" >
                            <option value="<{$item.id}>" <eq name="areaInfo['city']" value="$item['city']">selected</eq>><{$item.city}></option>
                        </foreach>
                    </neq>
                </select>
            </div>
            <div class="unit">
                <label>积分：</label>
                <input type="text" name="integral" size="15"  class="digits" value="<{$userInfo.integral}>"/>
            </div>
            <eq name="sign" value="">
                <div class="unit">
                    <label>公司网址：</label>
                    <input type="text" name="websit" size="15"  value="<{$userInfo.websit}>" class=""/>
                </div>
                <div class="unit">
                    <label>公司简介：</label>
                    <textarea name="addroduction" rows="10" cols="40"><{$userInfo.addroduction}></textarea>
                </div>
            </eq>
            <div id="preview1" href="">               
                <neq name="my['icon']" value=''>
                    <img src="<{$Think.const.PUBLIC_URL}>upload/<{$userInfo.icon}>" id='topPhpto'/>
                <else/>
                    <img src="<{$Think.const.PUBLIC_URL}>Images/hzw.jpg" id='topPhpto'/>
                </neq>
            </div>
            <div class="unit">
                <eq name="sign" value="">
                    <label>LOGO：</label>
                <else/>
                    <label>头像：</label>
                </eq>
                <input id="testFileInput2" type="file" name="icon"                                        
                    uploaderOption="{
			swf:'<{$Think.const.DWZ_URL}>uploadify/scripts/uploadify.swf',
			uploader:'__CONTROLLER__/upicon',
                        formData:{authId:<?php echo $_SESSION['authId'];?>, ajax:1},
			buttonText:'请选择文件',
			fileSizeLimit:'20000KB',
			fileTypeDesc:'*.jpg;*.jpeg;*.gif;*.png;',
			fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;',
			auto:true,
                        onUploadSuccess:function(file,data,respore){
                            $('#topPhpto').attr('src','<{$Think.const.PUBLIC_URL}>'+'upload/'+data);
                            $('#icon').val(data);
                        }
                    }"
                />
            </div>
            <div id="preview2" href=""> 
                <img src="<{$Think.const.PUBLIC_URL}>upload/<{$userInfo.license}>" id='topPhpto2'/>
            </div>
            <div class="unit">
                <label>营业执照：</label>  
                <input id="testFileInput3" type="file" name="icon"                                        
                    uploaderOption="{
			swf:'<{$Think.const.DWZ_URL}>uploadify/scripts/uploadify.swf',
			uploader:'__CONTROLLER__/upicon&uid=<?php echo $_SESSION['authId'];?>',
                        formData:{authId:<?php echo $_SESSION['authId'];?>, ajax:2},
			buttonText:'请选择文件',
			fileSizeLimit:'20000KB',
			fileTypeDesc:'*.jpg;*.jpeg;*.gif;*.png;',
			fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;',
			auto:true,
                        onUploadSuccess:function(file,data,respore){
                            $('#topPhpto2').attr('src','<{$Think.const.PUBLIC_URL}>'+'upload/'+data);
                            $('#license').val(data);
                        }
                    }"
                />
            </div>
        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
                <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
            </ul>
        </div>
    </form>	
</div>
<script>
    //头像预览
        function preview(file)  
        {  
            var prevDiv = document.getElementById('preview');  
            if (file.files && file.files[0])  
            {  
            var reader = new FileReader();  
            reader.onload = function(evt){  
            prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';  
           }    
            reader.readAsDataURL(file.files[0]);  
           }  
            else    
            {  
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';  
            }  
        }  
</script>